#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#define LEN_PATH    1024
#define LEN         1024
int main()
{
    pid_t pid = getpid();
    char path[LEN_PATH];
    snprintf(path, LEN_PATH, "/proc/%d/cmdline", pid);
    char str[LEN];
    FILE* fp = fopen(path, "r");
    int n;
    if(NULL != fp) {
        n = fread(str, 1, LEN-1, fp);
        fclose(fp);

        int i;
        for(i=0; i<n; i++) {
            if(isprint(str[i])) {
                printf("%c\n", str[i]);
            }
            else {
                printf("%d\n", str[i]);
            }
        }
    }

    return 0;
}
